﻿namespace ACCOUNTING.LVY.Business
{
    using ACCOUNTING;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Data;
    using System.Windows.Forms;

    public class clsChiPhiMuaHangChiTiet
    {
        private double mDonGia = 0.0;
        private string mHanSuDung = "";
        private string mKhoa = "";
        private string mKhoaChungTuChiPhi = "";
        private string mKhoaDonViTinh = "";
        private string mKhoaHangHoa = "";
        private string mKhoaKho = "";
        private string mKhoaPhieuNhap = "";
        private string mKhoaTKHangHoa = "";
        private string mLoaiTien = "";
        private string mNgayNhap = "";
        private double mQuyCach = 0.0;
        private string mSoLoHang = "";
        private double mSoLuong = 0.0;
        private string mSoSeri = "";
        private double mThanhTien = 0.0;
        private int mThueSuat = 0;
        private double mTienPhi = 0.0;
        private double mTienPhiNT = 0.0;
        private double mTienThue = 0.0;
        private double mTienThueNT = 0.0;
        private double mTyGia = 0.0;

        public bool Save()
        {
            bool flag=false;
            IDataParameter[] commandParameters = new IDataParameter[0x16];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@Khoa", DbType.Int64, ParameterDirection.Input, this.mKhoa);
                commandParameters[1] = DBHelper.createParameter("@KhoaChungTuChiPhi", DbType.Int64, ParameterDirection.Input, this.mKhoaChungTuChiPhi);
                commandParameters[2] = DBHelper.createParameter("@KhoaPhieuNhap", DbType.Int64, ParameterDirection.Input, this.mKhoaPhieuNhap);
                commandParameters[3] = DBHelper.createParameter("@KhoaKho", DbType.Int64, ParameterDirection.Input, this.mKhoaKho);
                commandParameters[4] = DBHelper.createParameter("@KhoaHangHoa", DbType.Int64, ParameterDirection.Input, this.mKhoaHangHoa);
                commandParameters[5] = DBHelper.createParameter("@KhoaDonViTinh", DbType.Int64, ParameterDirection.Input, this.mKhoaDonViTinh);
                commandParameters[6] = DBHelper.createParameter("@QuyCach", DbType.Date, ParameterDirection.Input, this.mQuyCach);
                commandParameters[7] = DBHelper.createParameter("@NgayNhap", DbType.Int64, ParameterDirection.Input, this.mNgayNhap);
                commandParameters[8] = DBHelper.createParameter("@SoSeri", DbType.Int64, ParameterDirection.Input, this.mSoSeri);
                commandParameters[9] = DBHelper.createParameter("@SoLoHang", DbType.Int64, ParameterDirection.Input, this.mSoLoHang);
                commandParameters[10] = DBHelper.createParameter("@HanSuDung", DbType.Int64, ParameterDirection.Input, this.mHanSuDung);
                commandParameters[11] = DBHelper.createParameter("@LoaiTien", DbType.Int64, ParameterDirection.Input, this.mLoaiTien);
                commandParameters[12] = DBHelper.createParameter("@TyGia", DbType.Date, ParameterDirection.Input, this.mTyGia);
                commandParameters[13] = DBHelper.createParameter("@SoLuong", DbType.Date, ParameterDirection.Input, this.mSoLuong);
                commandParameters[14] = DBHelper.createParameter("@DonGia", DbType.Date, ParameterDirection.Input, this.mDonGia);
                commandParameters[15] = DBHelper.createParameter("@ThanhTien", DbType.Date, ParameterDirection.Input, this.mThanhTien);
                commandParameters[0x10] = DBHelper.createParameter("@TienPhiNT", DbType.Date, ParameterDirection.Input, this.mTienPhiNT);
                commandParameters[0x11] = DBHelper.createParameter("@TienPhi", DbType.Date, ParameterDirection.Input, this.mTienPhi);
                commandParameters[0x12] = DBHelper.createParameter("@ThueSuat", DbType.Double, ParameterDirection.Input, this.mThueSuat);
                commandParameters[0x13] = DBHelper.createParameter("@TienThueNT", DbType.Date, ParameterDirection.Input, this.mTienThueNT);
                commandParameters[20] = DBHelper.createParameter("@TienThue", DbType.Date, ParameterDirection.Input, this.mTienThue);
                commandParameters[0x15] = DBHelper.createParameter("@KhoaTKHangHoa", DbType.Int64, ParameterDirection.Input, this.mKhoaTKHangHoa);
                if (DBHelper.ExecuteNonQuery(modGeneral.ConnectionString, CommandType.StoredProcedure, "ST_sp_ChiPhiMuaHangChiTiet", commandParameters) > 0)
                {
                    return true;
                }
                return false;
                flag = true;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                flag = false;
                ProjectData.ClearProjectError();
                return flag;
                ProjectData.ClearProjectError();
            }
            return flag;
        }

        public double DonGia
        {
            get
            {
                return this.mDonGia;
            }
            set
            {
                this.mDonGia = value;
            }
        }

        public string HanSuDung
        {
            get
            {
                return this.mHanSuDung;
            }
            set
            {
                this.mHanSuDung = value;
            }
        }

        public string Khoa
        {
            get
            {
                return this.mKhoa;
            }
            set
            {
                this.mKhoa = value;
            }
        }

        public string KhoaChungTuChiPhi
        {
            get
            {
                return this.mKhoaChungTuChiPhi;
            }
            set
            {
                this.mKhoaChungTuChiPhi = value;
            }
        }

        public string KhoaDonViTinh
        {
            get
            {
                return this.mKhoaDonViTinh;
            }
            set
            {
                this.mKhoaDonViTinh = value;
            }
        }

        public string KhoaHangHoa
        {
            get
            {
                return this.mKhoaHangHoa;
            }
            set
            {
                this.mKhoaHangHoa = value;
            }
        }

        public string KhoaKho
        {
            get
            {
                return this.mKhoaKho;
            }
            set
            {
                this.mKhoaKho = value;
            }
        }

        public string KhoaPhieuNhap
        {
            get
            {
                return this.mKhoaPhieuNhap;
            }
            set
            {
                this.mKhoaPhieuNhap = value;
            }
        }

        public string KhoaTKHangHoa
        {
            get
            {
                return this.mKhoaTKHangHoa;
            }
            set
            {
                this.mKhoaTKHangHoa = value;
            }
        }

        public string LoaiTien
        {
            get
            {
                return this.mLoaiTien;
            }
            set
            {
                this.mLoaiTien = value;
            }
        }

        public string NgayNhap
        {
            get
            {
                return this.mNgayNhap;
            }
            set
            {
                this.mNgayNhap = value;
            }
        }

        public double QuyCach
        {
            get
            {
                return this.mQuyCach;
            }
            set
            {
                this.mQuyCach = value;
            }
        }

        public string SoLoHang
        {
            get
            {
                return this.mSoLoHang;
            }
            set
            {
                this.mSoLoHang = value;
            }
        }

        public double SoLuong
        {
            get
            {
                return this.mSoLuong;
            }
            set
            {
                this.mSoLuong = value;
            }
        }

        public string SoSeri
        {
            get
            {
                return this.mSoSeri;
            }
            set
            {
                this.mSoSeri = value;
            }
        }

        public double ThanhTien
        {
            get
            {
                return this.mThanhTien;
            }
            set
            {
                this.mThanhTien = value;
            }
        }

        public int ThueSuat
        {
            get
            {
                return this.mThueSuat;
            }
            set
            {
                this.mThueSuat = value;
            }
        }

        public double TienPhi
        {
            get
            {
                return this.mTienPhi;
            }
            set
            {
                this.mTienPhi = value;
            }
        }

        public double TienPhiNT
        {
            get
            {
                return this.mTienPhiNT;
            }
            set
            {
                this.mTienPhiNT = value;
            }
        }

        public double TienThue
        {
            get
            {
                return this.mTienThue;
            }
            set
            {
                this.mTienThue = value;
            }
        }

        public double TienThueNT
        {
            get
            {
                return this.mTienThueNT;
            }
            set
            {
                this.mTienThueNT = value;
            }
        }

        public double TyGia
        {
            get
            {
                return this.mTyGia;
            }
            set
            {
                this.mTyGia = value;
            }
        }
    }
}

